<template>
	<view>
		<view class="item">
			<view style="padding: 20upx 20upx 0;">
				<u-icon name="info-circle-fill" color="#12B9A3" labelSize="13px"
					label="为了加快合作对接效率，请您填写以下信息，平台工作人员会在1-3个工作日内联系您。" label-color="#A7A7A7"></u-icon>

			</view>

		</view>

		<view class="item" style="margin-top: 0;">
			<view class="pop-input">
				<text>联系人*</text>
				<u-input v-model="contact" inputAlign="right" placeholder="请输入联系人" border="bottom" clearable
					maxlength="11">
				</u-input>
			</view>
			<view class="pop-input">
				<text>电话*</text>
				<u-input v-model="phone" type="number" inputAlign="right" placeholder="请输入联系电话" border="bottom"
					clearable maxlength="11">
				</u-input>
			</view>
			<view  style="margin: 20upx 20upx 0;">
				<text style="font-size: 28upx;color: $black33;">备注</text>

				<view class="input-bg">
					<u--textarea v-model="remark" placeholder="如有其他问题可选择备注说明" count>
					</u--textarea>
				</view>

			</view>
		</view>

		<view class="bottom-btn bottom">
			<text @click="btnClick">立即提交</text>
		</view>
	</view>
</template>

<script>
	import {cluescontractjoinsubmit} from '../../../common/api.js';
	
	export default {
		data() {
			return {
				id: '',
				contact: '',
				phone: '',
				remark:''
			}
		},
		methods: {
			btnClick(){
				if(uni.$u.test.isEmpty(this.contact)){
					uni.showToast({
						icon:'none',
						title:'请输入联系人'
					})
					return false;
				}
				if(!uni.$u.test.mobile(this.phone)){
					uni.showToast({
						icon:'none',
						title:'请输入正确的电话'
					})
					return false;
				}
				
				cluescontractjoinsubmit({
					phone: this.phone,
					activityId: this.id,
					remark: this.remark,
					contact: this.contact
				}).then(res=>{
					uni.showToast({
						icon:'none',
						title:'提交成功'
					})
					
					setTimeout(()=>{
						uni.navigateBack()
					}, 1000)
				})
				
			}
		},
		onLoad(op) {
			this.id = op.id;
		}
	}
</script>

<style lang="scss" scoped>
	.bottom {
		width: 100%;
		position: fixed;
		bottom: 0;
		z-index: 2;
	}

	.pop-input {
		@include flex;
		justify-content: space-between;
		align-items: center;
		font-size: 28upx;
		color: $black33;
		margin: 10upx 20upx 0;

	}

	.input-bg {
		margin: 20upx;
		border-radius: 5upx;
		border: solid 2upx $grayef;

	}
</style>
